package com.demo.parsers;

import org.json.JSONException;
import org.json.JSONObject;

import com.demo.engine.entity.BackData;
import com.demo.model.ServerInfoModel;

public class ServerInfoParser extends BaseParser{

	@Override
	public void Parse(String json, BackData backData) {
		if (!"".equals(json) && json != null) {
			try {
				ServerInfoModel serverInfo = new ServerInfoModel();
				JSONObject jobj = new JSONObject(json);
				serverInfo.setCode(jobj.getString("code"));
				serverInfo.setDescribe(jobj.getString("describe"));
				backData.setServerInfo(serverInfo);
			} catch (JSONException e) {
				e.printStackTrace();
				backData.setSuccess(false);
				backData.setMsg("parse server info error!");
			}
		}
	}

}
